home *** CD-ROM | disk | FTP | other *** search
- Path: news1.erols.com!newsmaster@erols.com
- From: "Stephen C. Marney" <scmarney@erols.com>
- Newsgroups: comp.lang.c++
- Subject: Re: How Do I Color A Button?
- Date: Mon, 18 Mar 1996 17:39:47 -0500
- Organization: Techsyn Company
- Message-ID: <314DE633.5BF4@erols.com>
- References: <4ik07d$7nj@cliffy.lfwc.lockheed.com>
- NNTP-Posting-Host: as6s48.erols.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- James Bassett wrote:
- >
- > Need to know how to color a button in a dialog box. I have tried using
- > SetBkColor, FillRect and CBrush class but with no results. HELP
- >
- > Jim Bassett
-
- >From MFC FAQ (courtesy of Scot Wingo): (Get it, the FAQ!)
-
- 6.2.6. How do I change the background color of a control?
-
- Your dialog can trap the WM_CTLCOLOR message, look up the MFC help file notes for CWnd::OnCtlColor(). Before a
- control is about to paint itself, the parent window receives a chance to set its own default text color and
- background brush.
-
- jmccabe@portage1.portup.com, mfc-l, 7/18/95
-
- Also check out the MS KB article ID: Q117778 TITLE: Changing the Background Color of an MFC Edit Control.
-
- Ramesh, MSMFC, 7/19/95
-
- 6.2.9. How do I change the background color of a BUTTON???
-
- NOTE: THE METHOD IN 6.2.6 WILL NOT WORK FOR BUTTONS!
-
- If you want to change the color of a dialog button, you have to use owner-draw button. (you can use bitmap
- buttons) Changing the color through OnCtlColor() will not work for buttons. The following Knowledge Base
- articles (GO MSKB on CIS) may be of help to you.
-
- ID: Q32685
- TITLE: Using the WM_CTLCOLOR Message
-
-
-
- ID: Q64328
- SAMPLE: Owner-Draw: 3-D Push Button Made from Bitmaps with Text
-
- This article explains sample code for a owner-draw button.
-
- Ramesh, NetQuest., MSMFC, 8/3/95
-
-